'''
Created on 2013-11-08

@author: Nich
'''
import unittest
import PyMud.command.commands as commands
from PyMud.tests.mocks.messanger_mock import PlayerMock

from unittest.mock import call, Mock
from PyMud.objects.components import Location


    

class TestCommands(unittest.TestCase):


    def setUp(self):
        self.command_context = {"calling_player_id":1521,
                                "calling_player_location": Location(0, 0, 1, 2, 3),
                                "some_other_junk" :"junk stuff",
                                "text":"Hello World"
                                }
        self.messanger = Mock()
        

    def tearDown(self):
        pass


    def testSay(self):
        commands.say(self.command_context, self.messanger)
        
        self.messanger.sendAVMessage.assert_called_with(msg_type = "player_say",
                                                        text = "Hello World", 
                           location = self.command_context["calling_player_location"], 
                           source_id = self.command_context["calling_player_id"], 
                           message_templates = commands.verbs["say"]["messages"]
                           )
        
        
    

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()